/*
This file is part of AI Agent Feed.

"AI Agent Feed" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

"AI Agent Feed" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with "AI Agent Feed".  If not, see <http://www.gnu.org/licenses/>.
 */
package com.feed.domain;

public class FeedCategory {
	private String siteName;
    private String name;
    
    public FeedCategory(String siteName, String name) {
        this.siteName = siteName;
        this.name = name;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + (siteName == null ? 0 : siteName.hashCode());
        result = PRIME * result + (name == null ? 0 : name.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        
        final FeedCategory other = (FeedCategory) obj;
        boolean same = true;
        same = siteName == null ? other.siteName == null : siteName.equals(other.siteName);
        if (!same) return false;
        same = name == null ? other.name == null : name.equals(other.name);
        if (!same) return false;
        
        return same;
    }

    @Override
    public String toString() {
        StringBuilder buffer = new StringBuilder();
        buffer.append(getClass().getSimpleName());
        buffer.append("[");
        buffer.append("siteName=").append(siteName);
        buffer.append(",name=").append(name);
        buffer.append("]");
        return buffer.toString();
    }
}
